home *** CD-ROM | disk | FTP | other *** search
/ MacHack 2001 / MacHack 2001.toast / pc / The Hacks / asciishopsource / AppClasses.jar / asciiShop / asciiLibs.class (.txt) next >
Encoding:
Java Class File  |  2001-06-23  |  4.2 KB  |  279 lines

  1. package asciiShop;
  2.  
  3. import java.io.BufferedReader;
  4. import java.io.IOException;
  5. import java.io.InputStreamReader;
  6.  
  7. public class asciiLibs {
  8.    char[][] editChar;
  9.    // $FF: renamed from: i int
  10.    int field_0;
  11.    // $FF: renamed from: j int
  12.    int field_1;
  13.    int countForVars;
  14.    String[] artBuffer;
  15.    int count;
  16.    String spaceCount = new String("");
  17.  
  18.    asciiLibs(String[] var1) {
  19.       this.artBuffer = var1;
  20.    }
  21.  
  22.    public void invert(int var1) {
  23.       this.editChar = new char[200][200];
  24.  
  25.       for(this.field_0 = 0; this.field_0 < var1; ++this.field_0) {
  26.          for(this.field_1 = 0; this.field_1 < this.artBuffer[this.field_0].length(); ++this.field_1) {
  27.             this.editChar[this.field_0][this.field_1] = this.artBuffer[this.field_0].charAt(this.field_1);
  28.          }
  29.       }
  30.  
  31.       for(this.field_0 = 0; this.field_0 < var1; ++this.field_0) {
  32.          for(this.field_1 = 0; this.field_1 < this.artBuffer[this.field_0].length(); ++this.field_1) {
  33.             System.out.print(this.editChar[this.field_0][this.field_1]);
  34.             ++this.count;
  35.          }
  36.  
  37.          System.out.println();
  38.       }
  39.  
  40.       System.out.println(this.count + " " + 1105);
  41.  
  42.       for(this.field_0 = 0; this.field_0 < var1; ++this.field_0) {
  43.          for(this.field_1 = 0; this.field_1 < this.artBuffer[this.field_0].length(); ++this.field_1) {
  44.             if (this.artBuffer[this.field_0].charAt(this.field_1) == '/') {
  45.                this.editChar[this.field_0][this.field_1] = '\\';
  46.             }
  47.  
  48.             if (this.artBuffer[this.field_0].charAt(this.field_1) == '\\') {
  49.                this.editChar[this.field_0][this.field_1] = '/';
  50.             }
  51.  
  52.             if (this.artBuffer[this.field_0].charAt(this.field_1) == '(') {
  53.                this.editChar[this.field_0][this.field_1] = ')';
  54.             }
  55.  
  56.             if (this.artBuffer[this.field_0].charAt(this.field_1) == ')') {
  57.                this.editChar[this.field_0][this.field_1] = '(';
  58.             }
  59.  
  60.             if (this.artBuffer[this.field_0].charAt(this.field_1) == ']') {
  61.                this.editChar[this.field_0][this.field_1] = '[';
  62.             }
  63.  
  64.             if (this.artBuffer[this.field_0].charAt(this.field_1) == '[') {
  65.                this.editChar[this.field_0][this.field_1] = ']';
  66.             }
  67.  
  68.             if (this.artBuffer[this.field_0].charAt(this.field_1) == '{') {
  69.                this.editChar[this.field_0][this.field_1] = '}';
  70.             }
  71.  
  72.             if (this.artBuffer[this.field_0].charAt(this.field_1) == '}') {
  73.                this.editChar[this.field_0][this.field_1] = '{';
  74.             }
  75.  
  76.             if (this.artBuffer[this.field_0].charAt(this.field_1) == '<') {
  77.                this.editChar[this.field_0][this.field_1] = '>';
  78.             }
  79.  
  80.             if (this.artBuffer[this.field_0].charAt(this.field_1) == '>') {
  81.                this.editChar[this.field_0][this.field_1] = '<';
  82.             }
  83.  
  84.             if (this.artBuffer[this.field_0].charAt(this.field_1) == '3') {
  85.                this.editChar[this.field_0][this.field_1] = 'E';
  86.             }
  87.  
  88.             if (this.artBuffer[this.field_0].charAt(this.field_1) == 'E') {
  89.                this.editChar[this.field_0][this.field_1] = '3';
  90.             }
  91.  
  92.             if (this.artBuffer[this.field_0].charAt(this.field_1) == 'b') {
  93.                this.editChar[this.field_0][this.field_1] = 'd';
  94.             }
  95.  
  96.             if (this.artBuffer[this.field_0].charAt(this.field_1) == 'd') {
  97.                this.editChar[this.field_0][this.field_1] = 'b';
  98.             }
  99.          }
  100.       }
  101.  
  102.       for(this.field_0 = 0; this.field_0 < var1; ++this.field_0) {
  103.          for(this.field_1 = 0; this.field_1 < this.artBuffer[this.field_0].length(); ++this.field_1) {
  104.             System.out.print(this.editChar[this.field_0][this.field_1]);
  105.             ++this.count;
  106.          }
  107.       }
  108.  
  109.       for(this.field_0 = 0; this.field_0 < var1; ++this.field_0) {
  110.          StringBuffer var2 = new StringBuffer(this.artBuffer[this.field_0].length());
  111.  
  112.          for(this.field_1 = 0; this.field_1 < this.artBuffer[this.field_0].length(); ++this.field_1) {
  113.             var2.append(this.editChar[this.field_0][this.field_1]);
  114.          }
  115.  
  116.          this.artBuffer[this.field_0] = var2.toString();
  117.       }
  118.  
  119.    }
  120.  
  121.    public void invertVert(int var1) {
  122.       this.editChar = new char[200][200];
  123.  
  124.       for(this.field_0 = 0; this.field_0 < var1; ++this.field_0) {
  125.          for(this.field_1 = 0; this.field_1 < this.artBuffer[this.field_0].length(); ++this.field_1) {
  126.             this.editChar[this.field_0][this.field_1] = this.artBuffer[this.field_0].charAt(this.field_1);
  127.          }
  128.       }
  129.  
  130.       for(this.field_0 = 0; this.field_0 < var1; ++this.field_0) {
  131.          for(this.field_1 = 0; this.field_1 < this.artBuffer[this.field_0].length(); ++this.field_1) {
  132.             System.out.print(this.editChar[this.field_0][this.field_1]);
  133.             ++this.count;
  134.          }
  135.  
  136.          System.out.println();
  137.       }
  138.  
  139.       System.out.println(this.count + " " + 1105);
  140.  
  141.       for(this.field_0 = 0; this.field_0 < var1; ++this.field_0) {
  142.          for(this.field_1 = 0; this.field_1 < this.artBuffer[this.field_0].length(); ++this.field_1) {
  143.             if (this.artBuffer[this.field_0].charAt(this.field_1) == '/') {
  144.                this.editChar[this.field_0][this.field_1] = '\\';
  145.             }
  146.  
  147.             if (this.artBuffer[this.field_0].charAt(this.field_1) == '\\') {
  148.                this.editChar[this.field_0][this.field_1] = '/';
  149.             }
  150.  
  151.             if (this.artBuffer[this.field_0].charAt(this.field_1) == 'Z') {
  152.                this.editChar[this.field_0][this.field_1] = 'S';
  153.             }
  154.  
  155.             if (this.artBuffer[this.field_0].charAt(this.field_1) == 'S') {
  156.                this.editChar[this.field_0][this.field_1] = 'Z';
  157.             }
  158.  
  159.             if (this.artBuffer[this.field_0].charAt(this.field_1) == 'p') {
  160.                this.editChar[this.field_0][this.field_1] = 'b';
  161.             }
  162.  
  163.             if (this.artBuffer[this.field_0].charAt(this.field_1) == 'b') {
  164.                this.editChar[this.field_0][this.field_1] = 'p';
  165.             }
  166.  
  167.             if (this.artBuffer[this.field_0].charAt(this.field_1) == 'q') {
  168.                this.editChar[this.field_0][this.field_1] = 'd';
  169.             }
  170.  
  171.             if (this.artBuffer[this.field_0].charAt(this.field_1) == 'v') {
  172.                this.editChar[this.field_0][this.field_1] = '^';
  173.             }
  174.  
  175.             if (this.artBuffer[this.field_0].charAt(this.field_1) == '^') {
  176.                this.editChar[this.field_0][this.field_1] = 'v';
  177.             }
  178.  
  179.             if (this.artBuffer[this.field_0].charAt(this.field_1) == 'd') {
  180.                this.editChar[this.field_0][this.field_1] = 'q';
  181.             }
  182.  
  183.             if (this.artBuffer[this.field_0].charAt(this.field_1) == 'm') {
  184.                this.editChar[this.field_0][this.field_1] = 'w';
  185.             }
  186.  
  187.             if (this.artBuffer[this.field_0].charAt(this.field_1) == 'w') {
  188.                this.editChar[this.field_0][this.field_1] = 'm';
  189.             }
  190.  
  191.             if (this.artBuffer[this.field_0].charAt(this.field_1) == 'M') {
  192.                this.editChar[this.field_0][this.field_1] = 'W';
  193.             }
  194.  
  195.             if (this.artBuffer[this.field_0].charAt(this.field_1) == 'n') {
  196.                this.editChar[this.field_0][this.field_1] = 'u';
  197.             }
  198.  
  199.             if (this.artBuffer[this.field_0].charAt(this.field_1) == 'u') {
  200.                this.editChar[this.field_0][this.field_1] = 'n';
  201.             }
  202.  
  203.             if (this.artBuffer[this.field_0].charAt(this.field_1) == 'J') {
  204.                this.editChar[this.field_0][this.field_1] = '7';
  205.             }
  206.  
  207.             if (this.artBuffer[this.field_0].charAt(this.field_1) == '7') {
  208.                this.editChar[this.field_0][this.field_1] = 'J';
  209.             }
  210.          }
  211.       }
  212.  
  213.       for(this.field_0 = 0; this.field_0 < var1; ++this.field_0) {
  214.          for(this.field_1 = 0; this.field_1 < this.artBuffer[this.field_0].length(); ++this.field_1) {
  215.             System.out.print(this.editChar[this.field_0][this.field_1]);
  216.             ++this.count;
  217.          }
  218.       }
  219.  
  220.       for(this.field_0 = 0; this.field_0 < var1; ++this.field_0) {
  221.          StringBuffer var2 = new StringBuffer(this.artBuffer[this.field_0].length());
  222.  
  223.          for(this.field_1 = 0; this.field_1 < this.artBuffer[this.field_0].length(); ++this.field_1) {
  224.             var2.append(this.editChar[this.field_0][this.field_1]);
  225.          }
  226.  
  227.          this.artBuffer[this.field_0] = var2.toString();
  228.       }
  229.  
  230.    }
  231.  
  232.    public void horizontalLine(int var1) {
  233.       new String("");
  234.       BufferedReader var3 = new BufferedReader(new InputStreamReader(System.in));
  235.  
  236.       try {
  237.          System.out.println("Which line(number) do you wish to change to a line?: ");
  238.          int var4 = Integer.parseInt(var3.readLine());
  239.          System.out.println("What character(number) would you like to start the conversion from?: ");
  240.          int var5 = Integer.parseInt(var3.readLine());
  241.          System.out.println("What character would you like to end the line at?: ");
  242.          int var6 = Integer.parseInt(var3.readLine());
  243.          char[] var7 = new char[this.artBuffer[var4].length()];
  244.  
  245.          for(int var9 = 0; var9 < this.artBuffer[var4].length(); ++var9) {
  246.             var7[var9] = '-';
  247.          }
  248.  
  249.          this.artBuffer[var4] = new String(var7);
  250.       } catch (IOException var10) {
  251.          System.out.println("Bad stuff has occured -2");
  252.       }
  253.  
  254.    }
  255.  
  256.    public void replaceChar(int var1) throws IOException {
  257.       boolean var3 = true;
  258.       boolean var4 = true;
  259.       BufferedReader var5 = new BufferedReader(new InputStreamReader(System.in));
  260.       System.out.println("What character would you like to replace: ");
  261.       char var6 = var5.readLine().charAt(0);
  262.       System.out.println("Wha character would you like to replace it with: ");
  263.       char var7 = var5.readLine().charAt(0);
  264.  
  265.       for(int var9 = 0; var9 < var1; ++var9) {
  266.          char[] var8 = this.artBuffer[var9].toCharArray();
  267.  
  268.          for(this.field_1 = 0; this.field_1 < var8.length; ++this.field_1) {
  269.             if (var8[this.field_1] == var6) {
  270.                var8[this.field_1] = var7;
  271.             }
  272.          }
  273.  
  274.          this.artBuffer[var9] = new String(var8);
  275.       }
  276.  
  277.    }
  278. }
  279.